﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="TabAdmin.aspx.cs" Inherits="Admin_TabAdmin" ValidateRequest="false" %>

<%@ Register Src="adminfoot.ascx" TagName="adminfoot" TagPrefix="uc1" %>

<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>无标题页</title>
<style type="text/css">
<!--
body {
-moz-background-clip:border;
-moz-background-inline-policy:continuous;
-moz-background-origin:padding;
font-family:Arial,Helvetica,sans-serif;
font-size:12px;
margin:0 auto;
padding:0;
text-align:left;
}
.modBottom, .footerBot {
-moz-background-clip:border;
-moz-background-inline-policy:continuous;
-moz-background-origin:padding;
background:transparent url(imgs/modAB.gif) repeat-x scroll left top;
height:4px;
overflow:hidden;
width:680px;
clear:both;
margin-left:10px;
_margin-left:5px;
margin-bottom:30px;
float:left;
}
.modBottom span.modABL, .modBottom span.modABR, .modTopB span.modATR, .modTopB span.modATL {
-moz-background-clip:border;
-moz-background-inline-policy:continuous;
-moz-background-origin:padding;
background:transparent url(imgs/bg.gif) no-repeat scroll left -28px;
float:left;
height:4px;
overflow:hidden;
width:4px;
}
.modBottom span.modABR {
-moz-background-clip:border;
-moz-background-inline-policy:continuous;
-moz-background-origin:padding;
background:transparent url(imgs/bg.gif) no-repeat scroll -4px -28px;
float:right;
}
.tabContainer {
-moz-background-clip:border;
-moz-background-inline-policy:continuous;
-moz-background-origin:padding;
background:transparent url(imgs/tab.gif) repeat-x scroll center bottom;
overflow:hidden;
width:680px;
margin-top:10px;
float:left;
margin-left:10px;
_margin-left:5px;
}
.tabContainer ul{
margin:0px;
padding:0px;
list-style-type:none;
}
.tabCot {
padding:0px 15px 10px;
color:#666666;
font-size:12px;
margin:0px;
font-family:Arial, Helvetica, sans-serif;
text-align:left;
overflow:auto;
_width:648px;
font-variant: small-caps;
font-size-adjust: none;
font-stretch:normal;
font-style:normal;
letter-spacing:inherit;
word-spacing:normal;
font-style:normal;
}

.tabContainer li.currentBtn {
-moz-background-clip:border;
-moz-background-inline-policy:continuous;
-moz-background-origin:padding;
background:transparent url(imgs/tabOn_right.gif) no-repeat scroll right top;
}
.tabContainer li {
-moz-background-clip:border;
-moz-background-inline-policy:continuous;
-moz-background-origin:padding;
background:transparent url(imgs/tabOff_right.gif) no-repeat scroll right top;
float:left;
margin-right:2px;
width:90px;
text-align:center;
}
.tabContainer li.currentBtn a {
-moz-background-clip:border;
-moz-background-inline-policy:continuous;
-moz-background-origin:padding;
background:transparent url(imgs/tabOn_left.gif) no-repeat scroll left top;
color:#000000;
height:28px;
}
.tabContainer li.currentBtn a:link,.tabContainer li.currentBtn a:visited{
color:#336699;
} 
.tabContainer li a {
color:#336699;
font-size:14px;
font-weight:bolder;
}
.tabContainer li a:link,.tabContainer li a:visited {
color:#333333;
}
.tabContainer li a {
-moz-background-clip:border;
-moz-background-inline-policy:continuous;
-moz-background-origin:padding;
background:transparent url(imgs/tabOff_left.gif) no-repeat scroll left top;
display:block !important;
height:27px;
line-height:27px;
text-align:center;
}

.tt { 
-moz-background-clip:border; 
-moz-background-inline-policy:continuous; 
-moz-background-origin:padding; 
background:transparent url(imgs/tabOff_right.gif) no-repeat scroll right top; 
float:left; 
margin-right:2px; 
width:30px; 
text-align:center; 
} 
.tt a{ 
-moz-background-clip:border; 
-moz-background-inline-policy:continuous; 
-moz-background-origin:padding; 
background:transparent url(imgs/tabOff_left.gif) no-repeat scroll left top; 
display:block !important; 
height:27px; 
line-height:27px; 
text-align:center; 
}
 -->
</style>
<link href="../Admin/imgs/admin.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../DotNet_net/js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="../DotNet_net/js/jquery.form.js"></script>
<script type="text/javascript" src="imgs/GetAjax.js"></script>
<script type="text/javascript" src="../DotNet_net/js/ui.tab.js"></script>
        
<script type="text/javascript"  defer="defer">
    function tab(tid,title)
    {
    	
        var tab = new $.fn.tab({
		tabList:".tabContainer li",
		contentList:".tabCot",
		tabActiveClass:"currentBtn",
		tabDisableClass:"",
			callBackStartEvent:function(){
		},
		callBackHideEvent:AjaxTab(tid,title),
		callBackShowEvent:function(){			
		}
	});

    }
    function AjaxTab(tid,title)
    {
            if($("#"+title).attr("title")=="0")
            {
               ajax_get(convertURL("TabAdmin.aspx?TabId="+tid),'',function(msg){
                $("#"+title).empty().html(msg)
                $("#"+title).attr("title","1");
               });
            }
            else
            { 
                $("#"+title).show();
            } 
    }
    function del(tid)
    {
        if(confirm("是否确定删除！"))
        {
            ajax_get(convertURL("TabAdmin.aspx?state=del&tid="+tid),'',function(msg){
                       if(msg=="1")
                       {
                            alert("删除成功！");
                            location.href="TabAdmin.aspx?productid="+$('#ProductID').attr('value');
                       }
                       else
                       {
                            alert(msg);
                       }
                   });
        }
    }
    function edit()
    {
        var tid=$(".tabContainer:eq(0) ul>.currentBtn").attr("title");   
        location.href="EditTab.aspx?tid="+tid+"&productid="+$("#ProductID").attr("value");
    }
    </script>
</head>
<body  onload='$("#loading").hide()'>
<div id="loading" style="display:block">   
    <div class="loading-indicator">   
        页面正在加载中...   
    </div>   
</div> 

    <form name="addform" id="addformAjax"  method="post" >
    <div class="container" id="cpcontainer">   
   <table class="tb">
        <tr class="thead" ><td colspan="4">
            Tab管理(<font color='red'>＊</font>为必填,其它选填)</td>
            <td colspan="1">
            </td>
        </tr>
        <tr>
            <td width="12%" style="height: 31px">
                Tab头部(TabTitle)：</td>
            <td colspan="3" style="height: 31px">
                <input id="TabTitle_txt" name="TabTitle_txt" type="text" runat="server" />
                &nbsp;<font color='red'>＊</font><span id="m_name_ok"></span>产品：                
                <span id="productName_span" runat="server"></span>
                <input id="ProductID" style="width: 61px;display:none" type="text" name="ProductID" runat="server"  /></td>
            <td colspan="1" style="height: 31px">
            </td>
        </tr>
       <tr>
           <td style="height: 31px" width="6%">
               Tab顺序(TabSort)：</td>
           <td colspan="3" style="height: 31px">
               &nbsp;<input id="TabSort" name="TabSort" type="text" style="width: 47px" runat="server" /></td>
           <td colspan="1" style="height: 31px">
           </td>
       </tr>
        <tr>
            <td style="height: 31px">
                Tab内容(TabContent)：</td>
            <td colspan="3" style="height: 31px"><fckeditorv2:fckeditor id="FCKeditor1" runat="server" height="300px" toolbarset="Zrnet" width="650px" ></fckeditorv2:fckeditor></td>
            <td colspan="1" style="height: 31px">
            </td>
        </tr>
        <tr>          
      <td width="6%"></td>
      <td class="forumRow" style="height: 27px" ><input type="button" class="btn" value="确认保存" name="Submit" id="tijiao"  />&nbsp;<input type="reset" class="btn" value="清 除"  onclick="resetCon('FCKeditor1')">&nbsp;<input type="button" class="btn" value="返　回" onClick="javascript:location.href='adminProduct.aspx';"/></td>
        </tr>
    </table>    
<script type="text/javascript">
function resetCon(source) {
    //document.addform.reset();
    var oEditor=FCKeditorAPI.GetInstance(source).EditorDocument.body.innerHTML="";
    return false;
}
</script>
<script type="text/javascript">
$(document).ready(function(){
    var options = { 
        beforeSubmit:  showRequest,  // pre-submit callback 
        success:       showResponse,  // post-submit callback 
        // other available options: 
         url:       "TabAdmin.aspx?state=insert",         // override for form's 'action' attribute 
       // type:        'post'        // 'get' or 'post', override for form's 'method' attribute 
        //dataType:  null        // 'xml', 'script', or 'json' (expected server response type) 
        clearForm: false,        // clear all form fields after successful submit 
        resetForm: false        // reset the form after successful submit 
 
        // $.ajax options can be used here too, for example: 
        //timeout:   3000 
    }; 
    $('#tijiao').click(function(){
         $("#loading").show();   
            var oEditor = FCKeditorAPI.GetInstance("FCKeditor1") ;   
            oEditor.UpdateLinkedField(); 
            $('#addformAjax').ajaxSubmit(options); 
            return false;   
    });
})
function showResponse(msg)
{ 
    if(msg=="1")
    {
        alert("添加成功!!!");  
        location.href=location.href;
    } 
    else
    {
        alert(msg);
    }
     $("#loading").hide();
}

function showRequest(formData, jqForm, options)
 { 		
    return true; 
} 

</script>
 </div>
<div id="tab" class="tabContainer">
<ul>
<%=TabTitle %>
</ul>
<div class="tt"><a href="javascript:edit()"><img src="imgs/0709161.gif" border="0" style=" margin-top:8px;"/></a></div>
</div>
<div id="tabcontent" style="width:678px; margin:0px; padding:0px; clear:both; float:left;margin-left:10px;_margin-left:5px;  border-right:1px solid #cccccc; border-left:1px solid #cccccc;">
<%=TabContent%>
</div>
<div class="modBottom"><span class="modABL">&nbsp;</span><span class="modABR">&nbsp;</span></div>
<div style="clear:both;">
      <uc1:adminfoot ID="Adminfoot1" runat="server" />
      </div>
   </form>
</body>
</html>
